package demo.ws.soap_spring_cxf;

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

/**
 * 静态代理客户端
 * 自行通过打包客户端jar，调用WS
 */
public class JaxWsClient {
    public static void main(String[] args){
        //facatory包含的信息：服务名字，请求信息等
        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setAddress("http://localhost:8080/ws/soap/hello");
        factory.setServiceClass(HelloService.class);

        HelloService helloService = factory.create(HelloService.class);
        String result = helloService.say("world");
        System.out.println(result);
    }
}
